package com.wzh.project.es.config;

import java.util.List;


/**
*@author : 汪振海
*@createdDate : Apr 9, 2020  7:40:57 PM
*@description : 此类写es的相关配置信息<br>
*
*/
public class ESConfig {
	
	private String name;
	private List<String> servers; // host:port
	private int maxRetryTimeoutMillis = 30000;		// 最大重试等待超时毫秒
	private int connectionRequestTimeout = 30000;	// 连接池中获取连接等待超时毫秒
	private int connectTimeout = 10000;				// 建立连接超时时间毫秒
	private int socketTimeout = 10000;				// 等待读取数据超时时间毫秒
	private int maxConnTotal = 30;					// 最大连接数
	private int maxConnPerRoute = 30;				// 每个路由对应的最大连接数
	//private SQL_PLUGIN sqlPlugin;					// sql插件类型
	private String dateFormat = "yyyy-MM-dd HH:mm:ss";
	
	@Override
	public String toString() {
		return String.format("{name: %s, servers: %s, maxConnTotal: %s, maxConnPerRoute: %s, maxRetryTimeout: %s, connectionRequestTimeout: %s, connectTimeout: %s, socketTimeout: %s, sqlPlugin: %s, dateFormat: %s}", 
				name, servers, maxConnTotal, maxConnPerRoute, maxRetryTimeoutMillis, connectionRequestTimeout, connectTimeout, socketTimeout, dateFormat);
	}

	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public List<String> getServers() {
		return servers;
	}
	public void setServers(List<String> servers) {
		this.servers = servers;
	}
	public int getMaxRetryTimeoutMillis() {
		return maxRetryTimeoutMillis;
	}
	public void setMaxRetryTimeoutMillis(int maxRetryTimeoutMillis) {
		this.maxRetryTimeoutMillis = maxRetryTimeoutMillis;
	}
	public int getConnectionRequestTimeout() {
		return connectionRequestTimeout;
	}
	public void setConnectionRequestTimeout(int connectionRequestTimeout) {
		this.connectionRequestTimeout = connectionRequestTimeout;
	}
	public int getConnectTimeout() {
		return connectTimeout;
	}
	public void setConnectTimeout(int connectTimeout) {
		this.connectTimeout = connectTimeout;
	}
	public int getSocketTimeout() {
		return socketTimeout;
	}
	public void setSocketTimeout(int socketTimeout) {
		this.socketTimeout = socketTimeout;
	}
	public int getMaxConnTotal() {
		return maxConnTotal;
	}
	public void setMaxConnTotal(int maxConnTotal) {
		this.maxConnTotal = maxConnTotal;
	}
	public int getMaxConnPerRoute() {
		return maxConnPerRoute;
	}
	public void setMaxConnPerRoute(int maxConnPerRoute) {
		this.maxConnPerRoute = maxConnPerRoute;
	}
	public String getDateFormat() {
		return dateFormat;
	}
	public void setDateFormat(String dateFormat) {
		this.dateFormat = dateFormat;
	}
	

}
